const xml2js = require("xml2js")
/**
 * @returns {Promise<object>}
 */
function parseXML(xml) {
	return new Promise((resolve, reject) => {
		xml2js.parseString(xml, {trim: true, explicitArray: false}, function (err, obj) {
			if (err) {
				return reject(err)
			}
			resolve(obj)
		})
	})
}

module.exports = {parseXML}